﻿@model LY.Manage.Model.sys_menu
@{
    Layout = null;
}
@using LY.Manage.Model
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>添加导航菜单</title>
    <!--引入文件-->
    <link href="~/Content/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/jquery.easyui.min.js"></script>
    <script src="~/Scripts/easyui-lang-zh_CN.js"></script>
    <script src="~/Scripts/datapattern.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <link href="~/Content/BaseStyle.css" rel="stylesheet" />

    <script type="text/javascript">
        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        $(function () {
            console.log(getUrlParam("ObjectId"));
            $('#ObjectId').val(getUrlParam("ObjectId"));
        });

        function subForm() {
            console.log("subForm--提交数据")
            $("#fmMain").submit();
        }
        function afterAdd(data) {
            console.log("sub-after-add:" + data);
            //调用父窗体中的方法
            window.parent.afterAdd(data);
        }

    </script>




</head>
<body>


    @using (Ajax.BeginForm("AddInfo", "SysMenu", new { }, new AjaxOptions()
{
    HttpMethod = "post",
    OnSuccess = "afterAdd"
}, new { id = "fmMain" }))
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)



        <input type="hidden" id="ObjectId" name="ObjectId" />
            <table class="DefTable">
            <tr>
               <td style="width:150px">菜单名称：</td>
               <td> @Html.EditorFor(model => model.MenuName)</td> 
               
               </tr>
               <tr>
                   <td style="width:150px">编码：</td>
                   <td> @Html.EditorFor(model => model.MenuCode)</td>

               </tr>
               <tr>
                   <td style="width:150px">上级菜单：</td>
                   <td> @*@Html.EditorFor(model => model.TreePath)*@
                       @Html.DropDownListFor(model => model.ParentCode, ViewBag.DevNameList as IEnumerable<SelectListItem>, new { @class = "form-control" })


                       @*@Html.DropDownList("MenuName", ViewBag.DevNameList as IEnumerable<SelectListItem>)*@
                   </td>

               </tr>
               <tr>
                   <td style="width:150px">图标：</td>
                   <td> @Html.EditorFor(model => model.IconClass)</td>

               </tr>
               <tr>
                   <td style="width:150px">链接地址：</td>
                   <td> @Html.EditorFor(model => model.IconURL)</td>
               </tr>
                <tr>
                    <td style="width:150px">是否可见：</td>
                    <td> @Html.EditorFor(model => model.IsVisible)</td>
                </tr>
                <tr>
                    <td style="width:150px">是否启用：</td>
                    <td> @Html.EditorFor(model => model.IsEnable)</td>
                </tr>
                <tr>
                    <td style="width:150px">排序：</td>
                    <td> @Html.EditorFor(model => model.MenuSeq)</td>
                </tr>
            </table>

       
    }

 
</body>
</html>
